namespace AdmissionQA.Domain.Entities;

public abstract class EntityBase
{
    /// <summary>
    /// 主键ID
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;

    /// <summary>
    /// 最后修改时间
    /// </summary>
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// 软删除标记
    /// </summary>
    public bool IsDeleted { get; private set; } = false;

    /// <summary>
    /// 实体描述
    /// </summary>
    public string? Description { get; set; } = null;

    /// <summary>
    /// 软删除方法
    /// </summary>
    public bool Delete()
    {
        if (IsDeleted)
        {
            return false;
        }
        IsDeleted = true;
        return true;
    }
}
